package com.lianjinsu.shop.service.impl;

import com.lianjinsu.shop.entity.Admin;
import com.lianjinsu.shop.repository.dao.AdminDao;
import com.lianjinsu.shop.service.AdminService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class AdminServiceImpl implements AdminService {
    private final AdminDao adminDao;

    @Override
    public Admin query(int id) {
        return adminDao.getById(id);
    }

    @Override
    public boolean insertOrUpdate(Admin admin) {
        return admin.insertOrUpdate();
    }

    @Override
    public boolean delete(int id) {
        return adminDao.removeById(id);
    }
}
